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

Query time 0.00035