UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RlnR8uPloLgo+CqOivqja0oj/gUzNL+/WEC7jzrIe7o=' 
WHERE 
  key_id = '4837138996712e2d60b573528246daec7d19d2fdda20d783fb9e3b1353932e8f' 
  AND (
    token = 'RlnR8uPloLgo+CqOivqja0oj/gUzNL+/WEC7jzrIe7o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035