UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'j/ONaln3Xd/4TNYLOEBxYetaujAqa4GgNJ+EkDFf/XI=' 
WHERE 
  key_id = '944b7d93b9e52c6263cf4653d55e04dddb5ab57f78c5cc43fbb8755f33a5146e' 
  AND (
    token = 'j/ONaln3Xd/4TNYLOEBxYetaujAqa4GgNJ+EkDFf/XI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00057