UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GfiM0jnf06UMO6u1TlNk8Y0S704GIbwwV4MzSKRmOJE=' 
WHERE 
  key_id = '74593e21b27f118c08f32545903a411114ea1c45d23c31b023ba785c43948ec9' 
  AND (
    token = 'GfiM0jnf06UMO6u1TlNk8Y0S704GIbwwV4MzSKRmOJE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046