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

Query time 0.00033