UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '61U+8SUGhMOsvJMRTo9M7MEBxllNgZQpLDxA2iL/Q78=' 
WHERE 
  key_id = '8c8b59df871377bf9074cff39db18ae9c296cd73ae14b221595d9c30004e522a' 
  AND (
    token = '61U+8SUGhMOsvJMRTo9M7MEBxllNgZQpLDxA2iL/Q78=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046