UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BwdN9aRLJfUb+4Tm/S22rV2+5nvV1rvZc5rZDbHeSZI=' 
WHERE 
  key_id = '2ecf65e6b4735947732f1cc6a3b7964dbb6a5bfdffcef47c98ed9a726e1844e1' 
  AND (
    token = 'BwdN9aRLJfUb+4Tm/S22rV2+5nvV1rvZc5rZDbHeSZI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047