UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LHL83/QdMQ6qKAt/koX+0KvW2Y2S6VXxys8tynCe7bE=' 
WHERE 
  key_id = '45a9c0c0a67aadb8950673c51483d7188b6579750fd0b84c07b3be2e924b1f0d' 
  AND (
    token = 'LHL83/QdMQ6qKAt/koX+0KvW2Y2S6VXxys8tynCe7bE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027