UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uOP8Bi2MdZ7cAd5EXq33EgGyllOuPkstimC1pqD9vrU=' 
WHERE 
  key_id = 'f3a2c4397a5a25b76fb4b0f365839d1e77835eb554f42c35a0ec64e4e3992d2a' 
  AND (
    token = 'uOP8Bi2MdZ7cAd5EXq33EgGyllOuPkstimC1pqD9vrU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039