UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tF7xoY0jfHVlPxUqDVGgN9T47uBJj1Lhdx7p/rTUTlE=' 
WHERE 
  key_id = '167d9bbbdde9f7bd1307b82ddd5c336f38904eb113dd1a33d2126c9d1be1f30f' 
  AND (
    token = 'tF7xoY0jfHVlPxUqDVGgN9T47uBJj1Lhdx7p/rTUTlE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021