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

Query time 0.00060