UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GJeimtn88YCGMNR5AV4fu97h8/foC6rNwHEV4trcbYI=' 
WHERE 
  key_id = 'ef65318f0a70522bb2b27fac5145c38f453c462f4840986bf5cae77dfe7c9f29' 
  AND (
    token = 'GJeimtn88YCGMNR5AV4fu97h8/foC6rNwHEV4trcbYI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023