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

Query time 0.00062