UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ky00kGdlgH9O+tbfleTxuJuXaXDsswO7drC0dG7En9M=' 
WHERE 
  key_id = '5a3bbd6ac251d6299d5d8c577f357538b7d6c5633816e9da09870e8ad33b6e11' 
  AND (
    token = 'Ky00kGdlgH9O+tbfleTxuJuXaXDsswO7drC0dG7En9M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048