UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'u2zzvZ1o9OqUlQ10CSx3Lnjtwy1RzLmiT7rcxGqj/qo=' 
WHERE 
  key_id = 'db2e4382d27d1332976aef687d66e129db35a8f6dedd55c6bfd1238b9710ac9a' 
  AND (
    token = 'u2zzvZ1o9OqUlQ10CSx3Lnjtwy1RzLmiT7rcxGqj/qo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038