UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YbYUqKrWCmtJxgmj0ao1EYMXb7EbAIy74IMQwD8zfzk=' 
WHERE 
  key_id = '4a74025bb000f168da51455216a52fb6d6b29161dec934fe990928ff4b440c2c' 
  AND (
    token = 'YbYUqKrWCmtJxgmj0ao1EYMXb7EbAIy74IMQwD8zfzk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037