UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dHaDbExrEeQ+arOqnE68866KyFBXwtpXoR8BKjHmg3g=' 
WHERE 
  key_id = '758ed84ec6a78e3634a01bf6f6096ec8969503b269701cf22a90ca61605d5a3f' 
  AND (
    token = 'dHaDbExrEeQ+arOqnE68866KyFBXwtpXoR8BKjHmg3g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022