UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'arhNA9Z+H2xmWd6QBrZYAcV1Ftb4Wxu6vjiIbGuYjO0=' 
WHERE 
  key_id = 'a955371d80b45e54bf9c4f54bd5acf3f3d62005fdb5f9813a4165dde85a1505c' 
  AND (
    token = 'arhNA9Z+H2xmWd6QBrZYAcV1Ftb4Wxu6vjiIbGuYjO0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030