UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xCX/AnRoIJr1qVx7pWECIgaDgNWVGtk6H5BsNpcQA38=' 
WHERE 
  key_id = 'c80d677337d2aa724d3e2d5909bc7e9b045e481abdeb7d862669d73508e943ba' 
  AND (
    token = 'xCX/AnRoIJr1qVx7pWECIgaDgNWVGtk6H5BsNpcQA38=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035