UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ai6Aw96Oj2n6X7pfFrTI90H7w3hIXHcfsXbVYLKNXNk=' 
WHERE 
  key_id = '7b0760f4663ac96ab871a000ba838bc517a7126e3ed84399d9f2ca58ebce7a99' 
  AND (
    token = 'Ai6Aw96Oj2n6X7pfFrTI90H7w3hIXHcfsXbVYLKNXNk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019