UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oEKSVqWOYy31QhztGHOkUd7Q12J0arxxdlMuJlD9RXA=' 
WHERE 
  key_id = '4882b6308fea23aa25e2e1d1f4d8a0a9c1d1f2b754bca19cf7f74fe6fa5785c7' 
  AND (
    token = 'oEKSVqWOYy31QhztGHOkUd7Q12J0arxxdlMuJlD9RXA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023