UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0vSY4J9TD9LNxY9JL1aW7Wl8yKYTLAXinavuE03komY=' 
WHERE 
  key_id = '09f60b2a793e35f413857d59fb49404b3b7acb8bc9460a677f17ca7669fb7ab5' 
  AND (
    token = '0vSY4J9TD9LNxY9JL1aW7Wl8yKYTLAXinavuE03komY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025