UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GlIvv8QGb2m8PzzrWWGQ+4lRtt1Nsk+Kv7hMIW36tpc=' 
WHERE 
  key_id = 'a62d8997b2097acaeafdd154bd5ccfe60011dc8348871e2629c8392ed1819051' 
  AND (
    token = 'GlIvv8QGb2m8PzzrWWGQ+4lRtt1Nsk+Kv7hMIW36tpc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026