UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5P9cuOCiaABuH2S4gVO3WmPBFWzSRvFB0dkm6PN5ZNw=' 
WHERE 
  key_id = '68393c1bcb13e1dd9192b8eed6c9f35fffd5f54ecbbcc38a0339af8464e79902' 
  AND (
    token = '5P9cuOCiaABuH2S4gVO3WmPBFWzSRvFB0dkm6PN5ZNw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00014