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

Query time 0.00032