UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'B2oJKCc4VSLkhstWXo9fHyH6rBb28qOnZWFKAikTXPE=' 
WHERE 
  key_id = '000653f0e5f15660a1d17615ace2df4fcccb94c55bc3135de37acad02199d415' 
  AND (
    token = 'B2oJKCc4VSLkhstWXo9fHyH6rBb28qOnZWFKAikTXPE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033